<?php
/*
 * 手机客户端 店铺-商品收藏接口
 * 传入参数 
 * 2014-03-24
 * 2014-05-08 (已查) 
 */
include "inc/public_header.php";
 
include "func/user.php";				//用户信息处理函数

$reJson = array();//构建返回值
 
$goodsId		= $_REQUEST["goodsId"];		//商品id

//获取用户信息
$uInfoArr = user_getInfoFromUUID();
if(!$uInfoArr){
	echo json_encode(array("success"=>"0","errCode"=>"0","msg"=>"没有获取到用户信息"));
	die;
}
$uid = $uInfoArr["uid"];//用户信息主键


$sql2 = "select sc_id from shop_product_sc where uid='".$uid."' and product_id='".$goodsId."'";
$db2->query($sql2);
if ($db2->next_record()){
	$sql = "delete from shop_product_sc where uid='".$uid."' and product_id='".$goodsId."'";
	$db->query($sql);
}else{

$sql = "insert into shop_product_sc (uid,product_id,sc_time) values('".$uid."','".$goodsId."',now())";
$db->query($sql);
}
$reJson["success"] = "1";
echo json_encode($reJson);
?>